package com.dualPointer;

public class RemoveDuplicatesfromSortedArray0202_26 {
    public int removeDuplicates(int[] nums) {
        int low = 0, fast = 1;
        while (fast<nums.length){
            while (nums[fast] == nums[fast-1]){
                fast++;
                if(fast == nums.length) return low+1;
            }
            low++;
            nums[low] = nums[fast];
            fast++;
        }
        return low+1;
    }

}
